import library
In [ ]:
from pyCMR.pyCMR import CMR
Provide config file.
In [ ]:
cmr=CMR("../cmr.cfg")
Search collection using keyword
In [ ]:
results = cmr.searchCollection(keyword='precipitation')
In [ ]:
print(len(results))
List fields
In [ ]:
print(results[0].keys())
In [ ]:
for res in results:
print("Short Name: "+ res['Collection']['ShortName'])
print("Dataset ID: " + res['Collection']['DataSetId'])
if res['Collection']['ArchiveCenter'] is not None:
print("Archive Center: " + res['Collection']['ArchiveCenter'])
if res['Collection']['Description'] is not None:
print("Description: " + res['Collection']['Description'])
if res['Collection']['Spatial']['HorizontalSpatialDomain']['Geometry']['BoundingRectangle'] is not None:
print("Bounding Rectangle: " + str(res['Collection']['Spatial']['HorizontalSpatialDomain']['Geometry']['BoundingRectangle']))
print("================================================")
In [ ]: